<template>
	<view class="content">
		<view class="box" v-for="item in reviewList">
			<view class="boximg">
				<image v-if="item.logo" :src="address+item.logo+'?imageView2/0/w/140'" mode="" class="pl_headImg"></image>
				<image v-else src="../../static/user.png" mode="" class="pl_headImg"></image>
			</view>
			<view class="font">
				<view style="font-size: 30upx; color: #333333;"> {{item.nick}}</view>
				<view style="color: #BEBEBE;"> {{item.time}}</view>
				<view class="pl">
					{{item.value}}
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	import eonfox from '@/components/eonfox/eonfox.js';
	import fns from '@/components/eonfox/fns.js';
	var ef = new eonfox();
	export default {
		data(){
			return{
				id:'',
				address:'',
				reviewList:''
			}
		},
		onLoad(e) {
			var that=this;
			that.id=e.id;
			ef.submit({
				request: {
					review:['USERCOMMENTLIST',[{module:"shop_goods",key:that.id,size:10}]] ,//that.id
					config: ['APPLICATIONCONFIG']
				},
				callback: function(data){
					var dataList=fns.checkError(data,['review','config'],function(errno,error){
						uni.showToast({
							title:error,
							icon:'none'
						})
					})
					if(dataList.config && dataList.config.qiniu_domain){
						that.address=dataList.config.qiniu_domain;//获取七牛的域名
					}
					if(dataList.review.data){
						that.reviewList=dataList.review.data
					}
					console.log('打印评论列表',dataList)
				},
				error: function(err){
					 fns.err('err',err)
				         console.log("出错啦", err);
				}
				})
		}
		
	}
</script>

<style>
	.content{
		width: 100%;
		height: auto;
		font-size:24upx;
		color: #555555;
		
	}
	.box{
		width: 98%;
		height: auto;
		padding-top: 10upx;
		padding-bottom: 10upx;
		border-bottom: 1upx #F1F1F3 solid;
		display: flex;
		padding-left: 2%;
	}
	.boximg{
		width:100upx;
		height:100upx;
	
	}
	.boximg image{
		width: 100%;
		height: 100%;
		border-radius: 50%;
	}
	.font{
		width:600upx;
		height:auto;
		margin-left: 20upx;
		margin-right: 20upx;
		word-wrap:break-word;
	}
	.pl{
		width:600upx;
		word-wrap:break-word;
	}
</style>
